
let user = {
    token: 'access_token',
    uploadToken: 'upload_token',
    panel: 'panel',
    getToken: function() {
        return sessionStorage.getItem(this.token);
    },
    setToken: function(token) {
        sessionStorage.removeItem(this.token);
        sessionStorage.setItem(this.token, token);
        return this;
    },
    removeToken: function() {
        sessionStorage.removeItem(this.token);
        return this;
    },
    getUploadToken: function() {
        return sessionStorage.getItem(this.uploadToken);
    },
    setUploadToken: function(token) {
        sessionStorage.removeItem(this.uploadToken);
        sessionStorage.setItem(this.uploadToken, token);
        return this;
    },
    getPanel: function() {
        return sessionStorage.getItem(this.panel);
    },
    setPanel: function(flag) {
        sessionStorage.removeItem(this.panel);
        sessionStorage.setItem(this.panel, flag);
        return this;
    }
};
export default user;